package com.cyc.basic.test.list;

/**
 * 标签类型枚举
 * 
 * @author zhangdongxu
 * 
 */
public enum EnumTagType {
    /** 0：企业标签 */
    //COMPANYTAG(0, "企业标签 "),
    /** 1：高端职位标签 */
    HIGHJOBTAG(1, "高端职位标签"),
    /** 2：低端职位标签 */
    LOWJOBTAG(2, "低端职位标签"), 
    /** 3: 发职位职位亮点标签 */
    JOBTAG(3, "职位标签"),
    /** 4: 发海外职位的职位亮点标签 */
    ABROADJOBTAG(4,"海外职位的职位亮点标签"),
    /** 5: 职位其他要求标签(目前用于海外职位) */
    JOBOTHERTAG(5, "职位其他要求标签"),
    /** 6: 职位技能标签 */
    JOBSKILLTAG(6, "职位技能标签");

    private Integer code;
    private String name;

    EnumTagType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static EnumTagType getEnum(Integer value) {
        if (value == null) {
            return null;
        }
        for (EnumTagType e : EnumTagType.values()) {
            if (e.getCode().equals(value)) {
                return e;
            }
        }
        return null;
    }

    public static EnumTagType getEnum(String str) {
        Integer value = null;
        try {
            value = Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return null;
        }
        return getEnum(value);
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return name;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setValue(String value) {
        this.name = value;
    }

}
